<?php

class InitListener implements Listener
{

    private function setUpSmarty() {
        BaseMvc::includeLib('Smarty', 'smarty');
        $smartyConfig = BaseMvc::$config->includeConfig('smarty', true);
        $smarty = new Smarty();
        $smarty->compile_dir = $smartyConfig['compile'];
        $smarty->cache_dir = $smartyConfig['cache_dir'];
        $smarty->config_dir = $smartyConfig['config_dir'];
        $smarty->template_dir = $smartyConfig['template_dir'];
        BaseMvc::$singleton->setSingleton('Smarty', $smarty);
    }

    public function actionPreformed($information = false) {
        $this->setUpSmarty();
    }

}